package one.stand.controller;

import com.github.pagehelper.PageInfo;
import one.stand.model.ResultModel;
import one.stand.request.CompanyCouponRequest;
import one.stand.response.CompanyCouponResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: QIK
 * @CreateDate: 2019/6/24 15:42
 */
@RestController
@RequestMapping("company/coupon")
public class CompanyCouponController extends BaseController {

    /**
     * 创建优惠券
     * @param request
     * @return
     */
    @PostMapping("add")
    public  ResultModel<Boolean> add(@RequestBody CompanyCouponRequest request){
       return companyCouponService.add(request);
    }

    /**
     * 修改优惠券
     * @param request
     * @return
     */
    @PostMapping("upd")
    public ResultModel<Boolean> upd(@RequestBody CompanyCouponRequest request){
        return companyCouponService.upd(request);
    }


    /**
     * 删除优惠券
     * @param request
     * @return
     */
    @PostMapping("del")
    public  ResultModel<Boolean> del(@RequestBody CompanyCouponRequest request){
        return companyCouponService.del(request);
    }

    /**
     * 获取优惠券列表
     * @param request
     * @return
     */
    @PostMapping("crmPcPageList")
    public ResultModel<PageInfo<CompanyCouponResponse>> crmPcPageList(@RequestBody CompanyCouponRequest request){
        return companyCouponService.crmPcPageList(request);
    }

}
